﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    public class Solution4
    {
        public void  ReverseString(string s1)
        {
            char[] s = s1.ToCharArray();
            StringBuilder sb = new StringBuilder();
            for (int i = s.Length - 1; i >= 0; i--)
            {
                sb.Append(s[i]);
            }
            char[] s2 = sb.ToString().ToCharArray();
            for (int i = 0; i < s2.Length; i++)
            {
                Console.Write(s2[i]);
            }

            Console.ReadKey();
            //for (int i = 0,j=s.Length-1; i < s.Length/2; i++,j--)
            //{
            //    char temp = s[i];
            //    s[i] = s[j];
            //    s[j] = temp;

            //}
            //for (int i = 0; i < s.Length; i++)
            //{
            //    Console.Write(s[i]);
            //}
            //Console.Read();
        }
    }
}
